////#include <bits/stdc++.h>
//#include<iostream>
//#include<cstdio>
//#include<iomanip>
//#include<cstdlib>
//#include <algorithm>
//#include<string.h>
//#include<set>
//#include<math.h>
//#define ll unsigned long long
//using namespace std;
//int j[100000];
//string s = "owo";
//int num;
//int judge(string st) {
//	int t = 0;
//	for (int i = 0; i <= st.size(); i++) {
//		if (i + 2 > st.size()) {
//			break;
//		}
//		if (st[i] == s[0] && st[i + 1] == s[1] && st[i + 2] == s[2]  ) {
//			t++;
//		}
//	}
//	return t;
//}
//int main () {
//	string s2;
//	string s3;
//	cin >> num;
//
//
//	for (int i = 0 ; i < num; i++) {
//		cin >> s2;
//		s3 += s2;
//		j[i] = judge(s3);
//	}
//	for (auto n : j) {
//		//TODO
//		if (n == 0) continue;
//		cout << n << endl;
//	}
//	return 0;
//}
#include<bits/stdc++.h>
using namespace std;
#define int long long
vector<string> s;
int count(int n)
{
	int cnt = 0, res = 0;
	vector<string> ss(s.begin(), s.begin() + n);
	string str;

	do {
		str = "";
		cnt = 0;
		for (int i = 0 ; i < n ; i++) {
			str += ss[i];
		}
//		cout << str << endl;
		for (int i = 0; i + 2 < (int) str.length(); ) {
			if (str[i] == 'o' && str[i + 1] == 'w' && str[i + 2] == 'o') {
				cnt ++;
				i += 2;
			}else{
				i++;
			}
		}
//		cout << "cnt =" << cnt<<endl;
		res = max(cnt, res);
	} while (next_permutation(ss.begin(), ss.end()));
	return res;
}
signed  main()
{
	int n;
	cin >> n;
	string sss;
	for (int i = 0; i < n; i++) {
		cin >> sss;
		s.push_back(sss);
	}
	vector<char> chars = {'a', 'b', 'c'};

	for (int i = 1; i <= n; i++) {
		cout << count(i)<<endl;
	}
	return 0;
}
